//
//  ViewController.m
//  CurbApp
//
//  Created by LH on 16/6/20.
//  Copyright © 2016年 LH. All rights reserved.
//

#import "ViewController.h"
#import "SecurityUtil.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    
  
}
- (IBAction)cleanBut:(id)sender {
    [[NSUserDefaults standardUserDefaults]removeObjectForKey:@"secretKey"];
}
- (IBAction)login:(id)sender {
    NSDictionary *dic=@{@"username":@"liu",@"password":@"123456",@"sex":@"",@"status":@"",@"createdTime":@"",@"uuid":@"",@"tel":@"",@"name":@"",@"photoId":@"",@"currentFee":@"",@"historyFee":@"",@"photoName":@"",@"photoPath":@"",};
    [LHNetWorking getLoginRequest:dic whileSuccess:^(id reponsObject) {
        NSMutableDictionary *dic=reponsObject;
        if ([dic objectForKey:@"sign"]) {
            NSString *sign=dic[@"sign"];
            NSLog(@"oldSign=%@",sign);
            [dic setValue:nil forKey:@"sign"];
        }
       // ab6f5b2237e1ba35ed05152184c36561
        //ab6f5b2237e1ba35ed05152184c36561
        [dic setValue:SECRETKEY forKey:@"secretKey"];
        NSLog(@"dic=%@",dic);
         NSString *signStr=[SecurityUtil md5s:[SecurityUtil dictionaryToString:dic]];
        NSLog(@"newSign=%@",signStr);
      
    } orFail:^(id responsObject) {
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
